'''
给定 文件夹 和 要查看的文件数量
'''
dir  = '/mnt/nas/shengjie/datasets/cloth_collar_balanced'
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-d','--dir',type=str,required=True)
parser.add_argument('-n','--num',type=int,default=10)
args = parser.parse_args()

print(f'show files ({args.num}):')

dir = args.dir
assert os.path.exists(dir),dir

count = 0
for entry in os.scandir(dir):
    filename = entry.name
    count += 1
    print(f'{count}\t[ ',filename,'\t',os.path.getsize( os.path.join( dir , filename ) ) / 1024 ,'KB ]')
    if count > args.num:
        break
